#ifndef NOTEBOOKBUTTON_H
#define NOTEBOOKBUTTON_H

#include <string>
#include <iostream>
#include <QtWidgets/QPushButton>
#include <QtGui/qevent.h>

#include "Config.h"

namespace hps {

class NoteBookButton: public QPushButton {
    Q_OBJECT
public:
    Q_SIGNALS:

    void leftButtonClicked();

    void rightButtonClicked();

protected:
    void mousePressEvent(QMouseEvent *event) override {
        if (event -> button() == Qt::LeftButton) {
            emit leftButtonClicked();
        }
        else if (event -> button() == Qt::RightButton) {
            emit rightButtonClicked();
        }
        QPushButton::mousePressEvent(event);
    }

public:
    NoteBookButton();

    void init();
    ButtonName::Button getButtonName() const { return m_buttonName; }
private:
    QIcon *m_icon;
    std::string m_buttonText = "noteBook";
    ButtonName::Button m_buttonName = ButtonName::noteBook;
};

} // hps

#endif //NOTEBOOKBUTTON_H
